<template>
	<view class="page">
		<view class="" style="margin-bottom: 20rpx;">
			<u-search v-model="from.petNickname"  shape="round" :showAction='false' @search='search'></u-search>
		</view>
		
		<u-swiper
		            :list="list3"
		            indicator
		            indicatorMode="line"
		            circular
		    ></u-swiper>
		<!-- <view class="xuanze around ">
			<view class="align">
				全国
				<img src="../../static/icon/xiashan.png" style="width: 30rpx;height: 30rpx;margin-left: 10rpx;" alt="" srcset="">
			</view>
			<view class="align">
				星球
				<img src="../../static/icon/xiashan.png" style="width: 30rpx;height: 30rpx;margin-left: 10rpx;" alt="" srcset="">
			</view>
			<view class="align">
				性别
				<img src="../../static/icon/xiashan.png" style="width: 30rpx;height: 30rpx;margin-left: 10rpx;" alt="" srcset="">
			</view>
			<view class="align">
				年龄
				<img src="../../static/icon/xiashan.png" style="width: 30rpx;height: 30rpx;margin-left: 10rpx;" alt="" srcset="">
			</view>
		</view> -->
		<view class="list" style="margin-top: 20rpx;">
			<view v-for="(item,index) in dataList" class="list_item display" @click="toDetails(item.uuid)">
				<view class="list_item_left">
					<view class="list_item_left_tittle">
						等待领养
					</view>
					<image style="width: 100%;height: 100%;" v-if="item.sintrReleaseImages && item.sintrReleaseImages.length > 0" :src="item.sintrReleaseImages[0].imageUrl" mode=""></image>
					<image style="width: 100%;height: 100%;" v-else mode=""></image>
				</view>
				<view class="list_item_right">
					<view class="list_item_right_top between">
						<view class="">
							<view class="">
								{{item.petNickname}}
							</view>
							<view class="list_item_right_top_name">
								{{item.breed}}
							</view>
						</view>
						<view class="">
							<img style="width: 60rpx;height: 60rpx;" src="../../static/zhiding.png" alt="" srcset="">
						</view>
					</view>
					<view class="display" style="margin-top: 10rpx;">
						<view class="list_item_right_bq" v-show="item.medicalTreatment&&item.medicalTreatment.includes(1)">
							已绝育
						</view>
						<view class="list_item_right_bq" v-show="item.medicalTreatment&&item.medicalTreatment.includes(2)">
							已免疫
						</view>
						<view class="list_item_right_bq" v-show="item.medicalTreatment&&item.medicalTreatment.includes(3)">
							已驱虫
						</view>
					</view>
					<view class="list_item_right_dq">
						{{item.city}}
					</view>
					<view class="between align list_item_right_bot">
						<view class="display">
							<!-- <img style="width: 30rpx;height: 30rpx;" src="../../static/ck.png" alt="" srcset=""> -->
							年龄：
							{{item.age}}
						</view>
						<!-- <view class="">
							2023-05-13 14:15 擦亮
						</view> -->
					</view>
				</view>
			</view>
			
			
		</view>
		<!-- <view class="select around">
			<view v-for="(item,index) in list1" :class="['select-item',Inv==index?'select-act':'']" @click="click(item,index)">{{item.name}}</view>
			
			
		</view> -->
	</view>
</template>

<script>
		import { list,bannerList } from "@/api/list.js"
	export default {
		data() {
			return {
				bannerList:[],
				from:{
					petNickname:''
				},
				dataList:[],
				list3: [
					
				],
				Inv: 0, 
				
				list1: [{
						name: '全国',
					}, {
						name: '星球',
					}, {
						name: '性别'
					}, {
						name: '年龄'
					}]
			}
		},
		onShow() {
			this.getList();
			this.getbannerList();
		},
		onLoad() {
	
		},
		methods: {
			getbannerList(){
				bannerList().then(result => {
					if (result.data.code == 200) {
						// this.carouselListUrl = [];
						this.bannerList=result.data.rows
						this.bannerList.forEach(item=>{
							this.list3.push(item.picture)
						})
					} else {
						uni.showToast({
							title: data.msg,
							icon: 'none',
							duration: 2000
						});
					}
				})
			},
			search(value){
				console.log(this.from)
				list(this.from).then(result => {
					if (result.data.code == 200) {
						// this.carouselListUrl = [];
						this.dataList=result.data.rows
					} else {
						uni.showToast({
							title: data.msg,
							icon: 'none',
							duration: 2000
						});
					}
				})
			},
			getList(){
				list().then(result => {
					if (result.data.code == 200) {
						// this.carouselListUrl = [];
						this.dataList=result.data.rows
					} else {
						uni.showToast({
							title: data.msg,
							icon: 'none',
							duration: 2000
						});
					}
				})
			},
			toDetails(uuid){
				uni.navigateTo({
					url: '/pages/lingyang/details?uuid='+uuid
				})
			},
		}
	}
</script>

<style scoped>
	.list_item{
		margin-bottom: 30rpx;
	}
	.list_item_right_bot{
		margin-top: 20rpx;
		color: #8a8a8a;
		font-size: 14px;
	}
	.list_item_right_dq{
		font-size: 14px;
		margin-top: 20rpx;
	}
	.list_item_right_bq{
		margin-right: 10rpx;
		font-size: 12px;
		padding: 8rpx;
		box-sizing: border-box;
		background-color: #FF8297;
		color: #fff;
	}
	.list_item_right{
		width: 100%;
		padding-left: 20rpx;
		box-sizing: border-box;
	}
	.list_item_right_top_name{
		font-size: 12px;
		color: #bfbfbf;
	}
	.list_item_left_tittle{
		position: absolute;
		left: 0;
		
		top: 0;
		font-size: 12px;
		padding: 8rpx;
		box-sizing: border-box;
		background-color: #FF8297;
		color: #fff;
	}
	.list_item_left{
		position: relative;
		width: 474rpx;
		height: 250rpx;
		border-radius: 10rpx;
		overflow: hidden;
	}
	.page{
		padding: 10px;
		box-sizing: border-box;
	}
	.xuanze{
		height: 30px;
	}
	.select{
		
		// width: 100%;
		height: 90rpx;
		display: flex;
		
		overflow-x: auto;
		width: 100%;
		background-color: #fff;
		
	}
	.select-item {
		 // display: inline-block;
			font-size: 32upx;
			padding-left: 10rpx;
			padding-right: 10rpx;
			// float: left;
			// width: 230rpx !important;
			text-align: center;
			color: #3D3D3D;
			height: 70upx;
			line-height: 70upx;
			// display: flex;
			// justify-content: center;
			// align-items: center;
			flex-shrink: 0;
		}
	.select-act {
			position:relative;
			z-index: 1;
			font-size:32rpx;
			color: #489BA0;
		}
	.select-act:before {
			content: '';
			width: 50%;
			height: 6rpx;
			background:#489BA0;
			position: absolute;
			bottom: 6rpx;
			left: 50%;
			z-index: -1;	
			transform: translateX(-50%);
		}
</style>